#ifndef __CC_DEVICE_MSG__
#define __CC_DEVICE_MSG__
#include "cc_config.h"
#if (CC_CONFIG_USE_DEVIEMSG == 1)
#include "abs_device.h"

enum
{
  CC_MSG_TYPE_RESET_STATE = 0,
  CC_MSG_TYPE_CMD,
  CC_MSG_TYPE_DTYPE,
  CC_MSG_TYPE_DID,
  CC_MSG_TYPE_CTYPE,
  CC_MSG_TYPE_AYNC,
  CC_MSG_TYPE_DATA,
};

enum
{
  CC_MSG_CMD_READ = 0,
  CC_MSG_CMD_WRITE,
  CC_MSG_CMD_CONTROL,
};

enum
{
  CC_MSG_AYNC = 0,
  CC_MSG_SYNC
};


typedef struct
{
  uint8_t cmd;    // read write control
  uint16_t device_type;
  uint16_t device_id;
  uint8_t ctrl_type;
  uint8_t is_aync;

  char* data;

} cc_device_msg, *cc_device_msg_t;

typedef struct
{
  user_device_t devices;
  cc_que_t que;
  cc_mutex_t mut;
  int node;
} device_msg_distr;

void cc_device_distr_data_handle(cc_mnode_t data_node);

#endif

#endif